<?php
// +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
// | NewThink [ Think More,Think Better! ]
// +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
// | Copyright (c) 2016~2018 http://www.newthink.cc All rights reserved.
// +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
// | 版权所有：山西创泰网络科技有限公司
// +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
// | Author: lk Date:2019/5/11 Time:10:37
// +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐

namespace app\api\controller;

use app\common\service\basic\BasicConfig;

class Config extends BaseController
{
    /**
     * 获取行业信息
     */
    public function getIndustryData()
    {
        try {
            $param = $this->request->param();
            $param['industry_type'] = $param['industry_type'] ?? 0;
    
            $basicConfig = new BasicConfig();
            $data = $basicConfig->getIndustryData($param['industry_type']);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $data);
    }
    
    /**
     * 获取公司信息
     */
    public function getCompanyData()
    {
        try {
            $param = $this->request->param();
            $param['industry_id'] = $param['industry_id'] ?? 0;
        
            $basicConfig = new BasicConfig();
            $data = $basicConfig->getCompanyData($param['industry_id']);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $data);
    }
    
    /**
     * 获取排口信息
     */
    public function getDrainData()
    {
        try {
            $param = $this->request->param();
            $param['company_id'] = $param['company_id'] ?? 0;
        
            $basicConfig = new BasicConfig();
            $data = $basicConfig->getDrainData($param['company_id']);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $data);
    }
    
    /**
     * 获取工艺设施编号
     */
    public function getFacilityData()
    {
        try {
            $param = $this->request->param();
            $basicConfig = new BasicConfig();
            $data = $basicConfig->getFacilityData($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        
        $this->success('成功', $data);
    }
}